#include <iostream>
#include <vector>
using namespace std;

int n, m;
int ia[105];
long long la[105];
vector<int> ans;

bool calc(int x) {
	int ires = 0;
	long long lres = 0; 
	for (int i = n; i >= 0; --i) {
		ires = ires * x + ia[i];
		lres = lres * x + la[i];
	}
	return ires == 0 && lres == 0;
}

int main() {
	cin >> n >> m;
	for (int i = 0; i <= n; ++i) {
		cin >> la[i];
		ia[i] = la[i];
	}
	
	for (int x = 1; x <= m; ++x) {
		if (calc(x)) ans.push_back(x);
	}
	
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); ++i) {
		cout << ans[i] << endl;
	}
	return 0;
}
